﻿using OwnerTools.viewmodel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace OwnerTools
{
    /// <summary>
    /// Login.xaml 的交互逻辑
    /// </summary>
    public partial class Login : Window
    {
        public Login()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            App.Current.MainWindow.Close();
        }
        private void Button_Login(object sender, RoutedEventArgs e)
        {
            string username = Username.Text;
            string password = Password.Password;
            UserViewModel? uvm = null;
            if (Application.TServiceProvider == null)
            App.TServiceProvider.GetService<UserViewModel>();
            if (username == "admin" && password == "123456")
            {
                App.Current.MainWindow.Show();
                
                this.Close();
            }
            else
            {
                MessageBox.Show("用户名或密码错误！");
            }
        }

        private void Button_Register(object sender, RoutedEventArgs e)
        {

        }
    }
}
